package com.example.widgetevent;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class TextActivity extends Activity {

	private EditText normalText;		//일반텍스트
	private EditText nameText;			//이름입력
	private EditText pwdText;				//비밀번호
	private EditText npwdText;			//숫자비밀번호	
	private EditText emailText;			//이메일주소
	private EditText telText;				//전화번호
	private EditText addrText;				//주소입력
	private EditText multiText;			//여러줄입력
	private EditText timeText;				//시간입력
	private EditText dateText;				//날짜입력
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_text);
		normalText = (EditText) findViewById(R.id.normalText);
		nameText = (EditText) findViewById(R.id.nameText);
		pwdText = (EditText) findViewById(R.id.pwdText);
		npwdText = (EditText) findViewById(R.id.npwdText);
		emailText = (EditText) findViewById(R.id.emailText);
		telText = (EditText) findViewById(R.id.telText);
		addrText = (EditText) findViewById(R.id.addrText);
		multiText = (EditText) findViewById(R.id.multiText);
		timeText = (EditText) findViewById(R.id.timeText);
		dateText = (EditText) findViewById(R.id.dateText);
		
	}
	//입력내용확인 클릭 이벤트 처리용 메서드
	public void showInput(View v){
		StringBuilder sb = new StringBuilder();
		
		sb.append(normalText.getText()).append("\n");
		sb.append(nameText.getText()).append("\n");
		sb.append(pwdText.getText()).append("\n");
		sb.append(npwdText.getText()).append("\n");
		sb.append(emailText.getText()).append("\n");
		sb.append(telText.getText()).append("\n");
		sb.append(addrText.getText()).append("\n");
		sb.append(multiText.getText()).append("\n");
		sb.append(timeText.getText()).append("\n");
		sb.append(dateText.getText()).append("\n");
		
		Toast.makeText(getApplicationContext(), sb.toString(), Toast.LENGTH_LONG).show();
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.text, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
